package cn.com.nes.mybatis.callcenter.mapper;

import cn.com.nes.site.entity.dto.patrolPlan.PatrolPlanEquipmentRecord;
import cn.com.nes.site.entity.vo.workOrder.QueryPatrolPlanEquipmentRecordVo;
import cn.com.nes.site.service.workOrder.dto.QueryPatrolPlanEquipmentRecordDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * @author nes
 */
public interface PatrolPlanEquipmentRecordMapper extends BaseMapper<PatrolPlanEquipmentRecord> {

    /**
     * 为所有待巡检设备创建一条默认记录
     *
     * @param companyId 公司id
     * @param patrolPlanId 计划id
     * @param userId 用户id
     * @return 插入数量
     */
    Integer insertDefaultRecords(@Param("companyId") String companyId,
                                 @Param("patrolPlanId") String patrolPlanId,
                                 @Param("userId") Long userId);

    void addDefaultDataItems(@Param("patrolPlanId")String patrolPlanId);
    PatrolPlanEquipmentRecord getPatrolPlanRecordBySbIdAndPlanId(@Param("patrolPlanId") String patrolPlanId,
                                                                 @Param("sbId") String sbId);
    List<QueryPatrolPlanEquipmentRecordDto> queryPatrolPlanEquipmentRecordByQuery(QueryPatrolPlanEquipmentRecordVo vo);
    PatrolPlanEquipmentRecord selectNewRecordByTaskId(@Param("taskId") String taskId);
}